(function(angular) {
	'use strict';
	angular.module("fs.waf").factory("i18nLoader", i18nLoader);

	i18nLoader.$inject = [ '$q', '$log', 'storageService', 'Constants', '$translate' ];
	function i18nLoader($q, $log, storageService, Constants, $translate) {
		var log = $log.getInstance('i18nLoader');
		return function(options) {
			var i18nResources1 = storageService.getItemFromSession(Constants.SESSION_I18N_RESOURES) || {};
			var i18nResources2 = storageService.getItemFromSession(Constants.SESSION_I18N_VALIDATION_RESOURES) || {};
			return $q.resolve(angular.merge(i18nResources1, i18nResources2));
		};
	}
})(angular);
